<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
	<%@include file="/WEB-INF/views/common/header.jsp" %>
</head>
<body>
<%@include file="/WEB-INF/views/common/top.jsp" %>
<%@include file="/WEB-INF/views/common/nav.jsp" %>

<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
	<div class="show-top-grids">
		<div class="main-grids about-main-grids">
			<h4>商品列表</h4>
			<div class="recommended-info">
				<hr class="layui-bg-green">
				<form class="form-inline" class="layui-form layui-form-pane" method="post"
				      action='<c:url value="/goods/list"/>'>
					<div class="row bs-example">
						<div class="form-group col-md-2">
							<input type="text" id="userName" name="userName" placeholder="商品名称" autocomplete="off"
							       value="" class="layui-input">
						</div>
					</div>


					<div class="row bs-example" style="margin-top: 1em;">
						<div class="form-group col-md-2">
							<button class="layui-btn" id="query" type="submit">查询</button>
							<button type="button" class="layui-btn layui-btn-primary" onclick="createUser();">添加商品
							</button>
						</div>
					</div>


					<div class="about-grids" style="margin-top: 2em;">
						<table class="layui-table">
							<thead>
							<tr>
								<th style="width:10%;">ID</th>
								<th style="width:10%;">商品名称</th>
								<th style="width:10%">商品价格</th>
								<th style="width:10%">类型</th>
								<th style="width:10%">操作</th>
							</tr>
							</thead>
							<tbody>
							<c:forEach items="${response.data}" var="goods" varStatus="status">
								<tr>
									<td>${user.id}</td>
									<td>${user.goodsName}</td>
									<td>${user.goodsPrice}</td>
									<td>
										分类
									</td>
									<td>
										<a onclick="decline(${category.id});"
										   class="layui-btn layui-btn-danger layui-btn-small">下架</a>
										<a onclick="edit(${category.id});"
										   class="layui-btn layui-btn-danger layui-btn-small">编辑</a>
										<a onclick="detail(${category.id});"
										   class="layui-btn layui-btn-danger layui-btn-small">详情</a>
										<a onclick="recommend(${category.id});"
										   class="layui-btn layui-btn-danger layui-btn-small">推荐</a>
									</td>
								</tr>
							</c:forEach>
							</tbody>
						</table>
					</div>
					<div>
						<jsp:include page="/WEB-INF/views/common/pagination.jsp"/>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

</body>

<script type="application/javascript">
	layui.use(['layer'], function () {
		window.layer = layui.layer;
	});

	/*导航栏参数*/
    var $nav_a = $("#ul_nav a[href='/user/list']");
	$nav_a.parent().addClass("active");
	$nav_a.parent().parent().css("display", "block");

	$(document).ready(function () {
	});

</script>


</html>
